package com.mzpai.product.service.impl;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mzpai.product.mapper.StoreSeckillMapper;
import com.mzpai.product.model.StoreSeckill;
import com.mzpai.product.service.StoreSeckillService;
import com.mzpai.product.vo.StoreProductSupplierDto;
import com.mzpai.product.vo.StoreSeckillVo;
import com.mzpai.service.impl.BaseServiceImpl;
import com.mzpai.util.PageUtil;

@Service
public class StoreSeckillServiceImpl extends BaseServiceImpl<StoreSeckill> implements StoreSeckillService {

	Logger logger = LoggerFactory.getLogger(StoreSeckillServiceImpl.class);

	@Autowired 
	private StoreSeckillMapper storeSeckillMapper;

	@Override
	public void insertBatch(List<StoreSeckill> storeSeckillList) {
		storeSeckillMapper.insertBatch(storeSeckillList);
	}


	@Override
	public PageInfo<StoreSeckillVo> getStoreSeckillByPage(Map<String, Object> map, Integer pageNum,Integer pageSize) {
		PageHelper.startPage(pageNum, pageSize);
		List<StoreSeckillVo> listStoreProductSupplierDto=storeSeckillMapper.getStoreSeckillByPage(map);
		return PageUtil.toPageInfo(listStoreProductSupplierDto);
	}

	
	@Override
	public StoreSeckill queryByPrimaryId(Integer id) {
		StoreSeckill storeSeckill=storeSeckillMapper.queryByPrimaryId(id);
		return storeSeckill;
	}

	
}